package com.atguigu.spzx.user.controller;

import com.atguigu.spzx.model.vo.common.Result;
import com.atguigu.spzx.user.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/user/sms/")
public class SmsController {

    @Autowired
    private UserInfoService userInfoService;

    @GetMapping("/sendCode/{phone}")
    public Result sendValidateCode(@PathVariable String phone){
        userInfoService.sendValidateCode(phone);
        return Result.ok(null);
    }
}
